package com.bsoft.exchange.dao.his;

import com.bsoft.exchange.domain.*;
import com.bsoft.exchange.pojo.AuditNetPrescriptionPojo;
import com.bsoft.exchange.pojo.NetPrescriptionListPojo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.sql.SQLException;
import java.util.List;

/**
 * 创建日期 : 2019/10/23
 * 创建人 : 赵太行
 */
public interface NetPrescriptionMapper {
    /**
     * 获取审方列表
     */

    List<NetPrescriptionDomain> getCf01List(@Param("pojo") NetPrescriptionListPojo pojo,
                                            @Param("CFHM") String cfhm,@Param("KSDM")List<Integer>ksdm);

    List<PrescriptionDrugDomain> getCf02List(@Param("pojo") NetPrescriptionListPojo pojo,
                                             @Param("cfsbList") List<Integer> cfsbList);

    List<PharmacyInfoDomain> getYFList(@Param("organizationId") String organizationId, @Param("doctorId") String doctorId) throws SQLException;


    PrescriptionDetailsDomain getDetails(@Param("JGID") String jgid, @Param("YSDM") String ysdm, @Param("CFSB") Integer cfsb);

    /**
     * 获取诊断记录
     */
    List<String> getGmypList(@Param("JGID") String jgid, @Param("BRID") String brid);

    /**
     * 提交审方结果
     */
    Integer auditPrescription(@Param("pojo") AuditNetPrescriptionPojo data) throws SQLException;

    /**
     * 重新提交审方结果
     */
    Integer auditRetryPrescription(@Param("JGID") String organizationId, @Param("CFSB") String prescriptionId) throws SQLException;
    /**
     * 获取处方02记录
     */
    List<Cf02Info>getCf02Info(@Param("JGID")String jgid,@Param("CFSB")String cfsb);
    /**
     * 插入审方记录表
     */
    Integer insertSfjl(@Param(value ="itemList")List<Cf02Info>pojo);
    Integer updateSfjlData(@Param("SFCS")Integer SFCS,@Param("SFJG")Integer SFJG,@Param("SFYJ")String SFYJ,
                           @Param("SFSJ")String SFSJ,@Param("JGID")String JGID,@Param("CFSB")String CFSB);
    /**
     * 获取处方条数
     */
    Integer getCf02Number(@Param("JGID")String jgid,@Param("CFSB")String cfsb);
    /**
     * 更新审方记录表
     */
    Integer updateSfjl(@Param("JGID") String organizationId, @Param("CFSB") String prescriptionId);

    PatientInfoDomain getPatient(@Param("BRID")String brid,@Param("YGDM")String ysdm,
                                 @Param("KSDM")String ksdm,@Param("JGID")String jgid);
    List<SfjgDomain> getNetPresctiptiInfo(@Param("JGID")String jgid,@Param("CFSB")String cfsb);

}
